package com.rd.student.ruanjian.class4.baiyunyao.DAY0728;

public class guoshandong {
    public static void main(String[] args) throws InterruptedException {
    Thread t1 = new Thread(new Runnable() {
        @Override
        public void run() {
            System.out.println("一号可以过山洞了");
            try {
                Thread.sleep(1000);
                System.out.println("一号通过山洞了");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    });

    Thread t2 = new Thread(new Runnable() {
        @Override
        public void run() {
            System.out.println("二号可以过山洞了");
            try {
                Thread.sleep(1000);
                System.out.println("二号通过山洞了");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    });

    Thread t3 = new Thread(new Runnable() {
        @Override
        public void run() {
            System.out.println("三号可以过山洞了");
            try {
                Thread.sleep(1000);
                System.out.println("三号通过山洞了");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    });

        Thread t4 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("四号可以过山洞了");
                try {
                    Thread.sleep(1000);
                    System.out.println("四号通过山洞了");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread t5 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("五号可以过山洞了");
                try {
                    Thread.sleep(1000);
                    System.out.println("五号通过山洞了");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread t6 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(
                        "六号可以过山洞了");
                try {
                    Thread.sleep(1000);
                    System.out.println("六号通过山洞了");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread t7 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("七号可以过山洞了");
                try {
                    Thread.sleep(1000);
                    System.out.println("七号通过山洞了");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread t8 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("八号可以过山洞了");
                try {
                    Thread.sleep(1000);
                    System.out.println("八号通过山洞了");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread t9 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("九号可以过山洞了");
                try {
                    Thread.sleep(1000);
                    System.out.println("九号通过山洞了");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread t10 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("十号可以过山洞了");
                try {
                    Thread.sleep(1000);
                    System.out.println("十号通过山洞了");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread t11 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("所有人均已通过山洞");

            }
        });
    t1.start();
    t1.join();
    t2.start();
    t2.join();
    t3.start();
    t3.join();
        t4.start();
        t4.join();
        t5.start();
        t5.join();
        t6.start();
        t6.join();
        t7.start();
        t7.join();
        t8.start();
        t8.join();
        t9.start();
        t9.join();
        t10.start();
        t10.join();
        t11.start();
        t11.join();

}
}

